<%@include file="../../../fragments/_taglibs.jsp" %>
<%@include file="../../../fragments/_message.jsp" %>
<link rel="stylesheet" type="text/css" href="${ctx}/css/css_plantilla/wizard_style.css">
<script type="text/javascript" src="${ctx}/js/js_plantilla/scripts/wizard_functions.js"></script>

<title>generador_formulario</title>

<div id="menueliminar">
    <ul>
        <li id="eliminar">Eliminar</li>
    </ul>
</div>


<form:form id="fsave" name="fsave" modelAttribute="wizardFormController" method="${wizardFormController.metodoV}"  action="./wizard/save/" >
    <div id="divresize" class="divresize">
        <div id="contenedor_toogler">Herramientas
            <div id="maintogler">-</div>
        </div>
        <div id="toogler">
           
            <img id="new_texto" style="cursor: pointer"  title="Nuevo Texto" onclick="create_text();" src="${pageContext.request.contextPath}/images/Texto.png">
            <img id="bloquear" style="cursor: pointer" title="Detener Construccion" onclick="stop();" src="${pageContext.request.contextPath}/images/Bloquear.png">
            <img id="desbloquear" style="cursor: pointer" title="Continuar Construccion" onclick="start();" src="${pageContext.request.contextPath}/images/Desbloquear.png">
            <a href="./wizard/preview/1">
                <img id="Vista Previa" style="cursor: pointer" title="Vista Previa"  src="${pageContext.request.contextPath}/images/Preview.png">
            </a>
            <img id="guardar" style="cursor: pointer" title="Guardar Seccion" onclick="SubmitSave('section', '');" src="${pageContext.request.contextPath}/images/Guardar.png">
            <img id="Orden" style="cursor: pointer" title="Definir Orden" onclick="onSubmit('./wizard/dorden/');" src="${pageContext.request.contextPath}/images/ordenar.png">
            <img id="Orden" style="cursor: pointer" title="Atras" onclick="onSubmit('./wizard/');" src="${pageContext.request.contextPath}/images/Atras.png">


        </div>
    </div>



    <div id="secciones_form" class="secciones">
        <div id="contenedor_toogler2">Campos 
            <div id="maintogler1">-</div>
        </div> 

        <div id="toogler1">
            <table>
              
                    <tr>
                        <td colspan="2" align="center"><b>Seccion  ${wizardFormController.nombreSeccion}</b></td>
                    </tr>
               

                <c:choose>
                    <c:when test="${wizardFormController.campos!=null && fn:length(wizardFormController.campos)>0}">
                        <c:forEach items="${wizardFormController.campos}" var="item">

                            <tr>
                                <td>${item.dcampo}"</td>
                                <td><input id="${item.id.ccampo}" onclick="create_input('${item.dcampo}', '${item.id.ccampo}', '${item.nlongitudExogena}');" type="checkbox"></td>
                            </tr>

                        </c:forEach>
                    </c:when>
                    <c:otherwise>
                        <tr>
                            <td colspan="2" align="center"><b>No Hay campos para esta seccion</b></td>
                        </tr>
                    </c:otherwise>
                </c:choose>
            </table>
        </div>
    </div>        

    <form:hidden  id="xFormatoSec" path="tbSeccionWizard.xformatoSec" ></form:hidden>        


        <div id="section">


        <c:choose>
            <c:when test="${wizardFormController.tbSeccionWizardDB!=null && fn:length(wizardFormController.tbSeccionWizardDB)>0}">

                <c:forEach items="${wizardFormController.tbSeccionWizardDB}" var="itemSec">
                    ${itemSec.xformatoSec}
                </c:forEach>
            </c:when>
        </c:choose>
    </div> 


    <c:choose>
        <c:when test="${wizardFormController.campos!=null && fn:length(wizardFormController.campos)>0}">
            <c:forEach items="${wizardFormController.campos}" var="item">
                <script>marcando('${item.id.ccampo}');</script>
            </c:forEach>
        </c:when>
        <c:otherwise>
        </c:otherwise>
    </c:choose>
</form:form>

